package com.howso.cloud.lb.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * client holder
 *
 */
public class ClientContextHolder {
    /**
     * 支持父子线程之间的数据传递
     */
    private static final ThreadLocal<String> CONTEXT = new TransmittableThreadLocal<>();

    public static void setClient(String client) {
        CONTEXT.set(client);
    }

    public static String getClient() {
        return CONTEXT.get();
    }

    public static void clear() {
        CONTEXT.remove();
    }
}
